home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_300
/
346_02
/
m16pst.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-02-08
|
11KB
|
358 lines
/* m16pst.c */
/*
* (C) Copyright 1991
* All Rights Reserved
*
* Alan R. Baldwin
* 721 Berkeley St.
* Kent, Ohio 44240
*/
#include <stdio.h>
#include <setjmp.h>
#include "asm.h"
#include "m6816.h"
struct mne mne[] = {
/* machine */
NULL, ".setdp", S_SDP, 0, 0,
/* system */
NULL, "CON", S_ATYP, 0, A_CON,
NULL, "OVR", S_ATYP, 0, A_OVR,
NULL, "REL", S_ATYP, 0, A_REL,
NULL, "ABS", S_ATYP, 0, A_ABS|A_OVR,
NULL, "NOPAG", S_ATYP, 0, A_NOPAG,
NULL, "PAG", S_ATYP, 0, A_PAG,
NULL, ".byte", S_BYTE, 0, 0,
NULL, ".db", S_BYTE, 0, 0,
NULL, ".word", S_WORD, 0, 0,
NULL, ".dw", S_WORD, 0, 0,
NULL, ".ascii", S_ASCII, 0, 0,
NULL, ".asciz", S_ASCIZ, 0, 0,
NULL, ".blkb", S_BLK, 0, 1,
NULL, ".ds", S_BLK, 0, 1,
NULL, ".blkw", S_BLK, 0, 2,
NULL, ".page", S_PAGE, 0, 0,
NULL, ".title", S_TITLE, 0, 0,
NULL, ".sbttl", S_SBTL, 0, 0,
NULL, ".globl", S_GLOBL, 0, 0,
NULL, ".area", S_DAREA, 0, 0,
NULL, ".even", S_EVEN, 0, 0,
NULL, ".odd", S_ODD, 0, 0,
NULL, ".if", S_IF, 0, 0,
NULL, ".else", S_ELSE, 0, 0,
NULL, ".endif", S_ENDIF, 0, 0,
NULL, ".include", S_INCL, 0, 0,
NULL, ".radix", S_RADIX, 0, 0,
NULL, ".org", S_ORG, 0, 0,
NULL, ".module", S_MODUL, 0, 0,
/* machine */
NULL, "ais", S_IMMA, 0, 0x3F,
NULL, "aix", S_IMMA, 0, 0x3C,
NULL, "aiy", S_IMMA, 0, 0x3D,
NULL, "aiz", S_IMMA, 0, 0x3E,
NULL, "andp", S_IM16, 0, 0x2A,
NULL, "orp", S_IM16, 0, 0x3B,
NULL, "bclr", S_BIT, 0, 0x08,
NULL, "bset", S_BIT, 0, 0x09,
NULL, "bclrw", S_BITW, 0, 0x08,
NULL, "bsetw", S_BITW, 0, 0x09,
NULL, "brclr", S_BRBT, 0, 0x0A,
NULL, "brset", S_BRBT, 0, 0x0B,
NULL, "lded", S_LDED, 0, 0x71,
NULL, "mac", S_MAC, 0, 0x7B,
NULL, "rmac", S_MAC, 0, 0xFB,
NULL, "pshm", S_PSHM, 0, 0x34,
NULL, "pulm", S_PULM, 0, 0x35,
NULL, "jmp", S_JXX, 0, 0x4B,
NULL, "jsr", S_JXX, 0, 0x89,
NULL, "movb", S_MOVB, 0, 0x30,
NULL, "movw", S_MOVW, 0, 0x31,
NULL, "cps", S_CMP, 0, 0x4F,
NULL, "cpx", S_CMP, 0, 0x4C,
NULL, "cpy", S_CMP, 0, 0x4D,
NULL, "cpz", S_CMP, 0, 0x4E,
NULL, "lds", S_LOAD, 0, 0xCF,
NULL, "ldx", S_LOAD, 0, 0xCC,
NULL, "ldy", S_LOAD, 0, 0xCD,
NULL, "ldz", S_LOAD, 0, 0xCE,
NULL, "sts", S_STOR, 0, 0x8F,
NULL, "stx", S_STOR, 0, 0x8C,
NULL, "sty", S_STOR, 0, 0x8D,
NULL, "stz", S_STOR, 0, 0x8E,
NULL, "aslw", S_SOPW, 0, 0x04,
NULL, "asrw", S_SOPW, 0, 0x0D,
NULL, "clrw", S_SOPW, 0, 0x05,
NULL, "comw", S_SOPW, 0, 0x00,
NULL, "decw", S_SOPW, 0, 0x01,
NULL, "incw", S_SOPW, 0, 0x03,
NULL, "lslw", S_SOPW, 0, 0x04,
NULL, "lsrw", S_SOPW, 0, 0x0F,
NULL, "negw", S_SOPW, 0, 0x02,
NULL, "rolw", S_SOPW, 0, 0x0C,
NULL, "rorw", S_SOPW, 0, 0x0E,
NULL, "tstw", S_SOPW, 0, 0x06,
NULL, "asl", S_SOP, 0, 0x04,
NULL, "asr", S_SOP, 0, 0x0D,
NULL, "clr", S_SOP, 0, 0x05,
NULL, "com", S_SOP, 0, 0x00,
NULL, "dec", S_SOP, 0, 0x01,
NULL, "inc", S_SOP, 0, 0x03,
NULL, "lsl", S_SOP, 0, 0x04,
NULL, "lsr", S_SOP, 0, 0x0F,
NULL, "neg", S_SOP, 0, 0x02,
NULL, "rol", S_SOP, 0, 0x0C,
NULL, "ror", S_SOP, 0, 0x0E,
NULL, "tst", S_SOP, 0, 0x06,
NULL, "adce", S_DOPE, 0, 0x43,
NULL, "adde", S_DOPE, 0, 0x41,
NULL, "ande", S_DOPE, 0, 0x46,
NULL, "cpe", S_DOPE, 0, 0x48,
NULL, "eore", S_DOPE, 0, 0x44,
NULL, "lde", S_DOPE, 0, 0x45,
NULL, "ore", S_DOPE, 0, 0x47,
NULL, "sbce", S_DOPE, 0, 0x42,
NULL, "ste", S_DOPE, 0, 0x4A,
NULL, "sube", S_DOPE, 0, 0x40,
NULL, "adcd", S_DOPD, 0, 0x83,
NULL, "addd", S_DOPD, 0, 0x81,
NULL, "andd", S_DOPD, 0, 0x86,
NULL, "cpd", S_DOPD, 0, 0x88,
NULL, "eord", S_DOPD, 0, 0x84,
NULL, "ldd", S_DOPD, 0, 0x85,
NULL, "ord", S_DOPD, 0, 0x87,
NULL, "sbcd", S_DOPD, 0, 0x82,
NULL, "std", S_DOPD, 0, 0x8A,
NULL, "subd", S_DOPD, 0, 0x80,
NULL, "adca", S_DOP, 0, 0x43,
NULL, "adcb", S_DOP, 0, 0xC3,
NULL, "adda", S_DOP, 0, 0x41,
NULL, "addb", S_DOP, 0, 0xC1,
NULL, "anda", S_DOP, 0, 0x46,
NULL, "andb", S_DOP, 0, 0xC6,
NULL, "bita", S_DOP, 0, 0x49,
NULL, "bitb", S_DOP, 0, 0xC9,
NULL, "cmpa", S_DOP, 0, 0x48,
NULL, "cmpb", S_DOP, 0, 0xC8,
NULL, "eora", S_DOP, 0, 0x44,
NULL, "eorb", S_DOP, 0, 0xC4,
NULL, "ldaa", S_DOP, 0, 0x45,
NULL, "ldab", S_DOP, 0, 0xC5,
NULL, "oraa", S_DOP, 0, 0x47,
NULL, "orab", S_DOP, 0, 0xC7,
NULL, "sbca", S_DOP, 0, 0x42,
NULL, "sbcb", S_DOP, 0, 0xC2,
NULL, "staa", S_DOP, 0, 0x4A,
NULL, "stab", S_DOP, 0, 0xCA,
NULL, "suba", S_DOP, 0, 0x40,
NULL, "subb", S_DOP, 0, 0xC0,
NULL, "aba", S_INH37, 0, 0x0B,
NULL, "abx", S_INH37, 0, 0x4F,
NULL, "aby", S_INH37, 0, 0x5F,
NULL, "abz", S_INH37, 0, 0x6F,
NULL, "ace", S_INH37, 0, 0x22,
NULL, "aced", S_INH37, 0, 0x23,
NULL, "adx", S_INH37, 0, 0xCD,
NULL, "ady", S_INH37, 0, 0xDD,
NULL, "adz", S_INH37, 0, 0xED,
NULL, "aex", S_INH37, 0, 0x4D,
NULL, "aey", S_INH37, 0, 0x5D,
NULL, "aez", S_INH37, 0, 0x6D,
NULL, "asla", S_INH37, 0, 0x04,
NULL, "aslb", S_INH37, 0, 0x14,
NULL, "asra", S_INH37, 0, 0x0D,
NULL, "asrb", S_INH37, 0, 0x1D,
NULL, "bgnd", S_INH37, 0, 0xA6,
NULL, "cba", S_INH37, 0, 0x1B,
NULL, "clra", S_INH37, 0, 0x05,
NULL, "clrb", S_INH37, 0, 0x15,
NULL, "coma", S_INH37, 0, 0x00,
NULL, "comb", S_INH37, 0, 0x10,
NULL, "daa", S_INH37, 0, 0x21,
NULL, "deca", S_INH37, 0, 0x01,
NULL, "decb", S_INH37, 0, 0x11,
NULL, "ediv", S_INH37, 0, 0x28,
NULL, "edivs", S_INH37, 0, 0x29,
NULL, "emul", S_INH37, 0, 0x25,
NULL, "emuls", S_INH37, 0, 0x26,
NULL, "fdiv", S_INH37, 0, 0x2B,
NULL, "fmuls", S_INH37, 0, 0x27,
NULL, "idiv", S_INH37, 0, 0x2A,
NULL, "inca", S_INH37, 0, 0x03,
NULL, "incb", S_INH37, 0, 0x13,
NULL, "lsla", S_INH37, 0, 0x04,
NULL, "lslb", S_INH37, 0, 0x14,
NULL, "lsra", S_INH37, 0, 0x0F,
NULL, "lsrb", S_INH37, 0, 0x1F,
NULL, "mul", S_INH37, 0, 0x24,
NULL, "nega", S_INH37, 0, 0x02,
NULL, "negb", S_INH37, 0, 0x12,
NULL, "psha", S_INH37, 0, 0x08,
NULL, "pshb", S_INH37, 0, 0x18,
NULL, "pula", S_INH37, 0, 0x09,
NULL, "pulb", S_INH37, 0, 0x19,
NULL, "rola", S_INH37, 0, 0x0C,
NULL, "rolb", S_INH37, 0, 0x1C,
NULL, "rora", S_INH37, 0, 0x0E,
NULL, "rorb", S_INH37, 0, 0x1E,
NULL, "sba", S_INH37, 0, 0x0A,
NULL, "swi", S_INH37, 0, 0x20,
NULL, "tab", S_INH37, 0, 0x17,
NULL, "tap", S_INH37, 0, 0xFD,
NULL, "tba", S_INH37, 0, 0x07,
NULL, "tbsk", S_INH37, 0, 0x9F,
NULL, "tbxk", S_INH37, 0, 0x9C,
NULL, "tbyk", S_INH37, 0, 0x9D,
NULL, "tbzk", S_INH37, 0, 0x9E,
NULL, "tdmsk", S_INH37, 0, 0x2F,
NULL, "tdp", S_INH37, 0, 0x2D,
NULL, "tpa", S_INH37, 0, 0xFC,
NULL, "tpd", S_INH37, 0, 0x2C,
NULL, "tskb", S_INH37, 0, 0xAF,
NULL, "tsta", S_INH37, 0, 0x06,
NULL, "tstb", S_INH37, 0, 0x16,
NULL, "txkb", S_INH37, 0, 0xAC,
NULL, "txs", S_INH37, 0, 0x4E,
NULL, "tykb", S_INH37, 0, 0xAD,
NULL, "tys", S_INH37, 0, 0x5E,
NULL, "tzkb", S_INH37, 0, 0xAE,
NULL, "tzs", S_INH37, 0, 0x6E,
NULL, "xgab", S_INH37, 0, 0x1A,
NULL, "xgdx", S_INH37, 0, 0xCC,
NULL, "xgdy", S_INH37, 0, 0xDC,
NULL, "xgdz", S_INH37, 0, 0xEC,
NULL, "xgex", S_INH37, 0, 0x4C,
NULL, "xgey", S_INH37, 0, 0x5C,
NULL, "xgez", S_INH37, 0, 0x6C,
NULL, "ade", S_INH27, 0, 0x78,
NULL, "asld", S_INH27, 0, 0xF4,
NULL, "asle", S_INH27, 0, 0x74,
NULL, "aslm", S_INH27, 0, 0xB6,
NULL, "asrd", S_INH27, 0, 0xFD,
NULL, "asre", S_INH27, 0, 0x7D,
NULL, "asrm", S_INH27, 0, 0xBA,
NULL, "clrd", S_INH27, 0, 0xF5,
NULL, "clre", S_INH27, 0, 0x75,
NULL, "clrm", S_INH27, 0, 0xB7,
NULL, "comd", S_INH27, 0, 0xF0,
NULL, "come", S_INH27, 0, 0x70,
NULL, "ldhi", S_INH27, 0, 0xB0,
NULL, "lpstop", S_INH27, 0, 0xF1,
NULL, "lsld", S_INH27, 0, 0xF4,
NULL, "lsle", S_INH27, 0, 0x74,
NULL, "lslm", S_INH27, 0, 0xB6,
NULL, "lsrd", S_INH27, 0, 0xFF,
NULL, "lsre", S_INH27, 0, 0x7F,
NULL, "negd", S_INH27, 0, 0xF2,
NULL, "nege", S_INH27, 0, 0x72,
NULL, "nop", S_INH27, 0, 0x4C,
NU